<template>
  <div>
    <span>子组件</span>
    <h1>{{ value }}</h1>
    <input type="text" ref="inputRef" />
    <button @click="handle" ref="buttonRef">v-model按钮</button>
  </div>
</template>

<script>
export default {
  props: {
    value: {
      type: String,
    },
  },
  data() {
    return {}
  },
  methods: {
    handle() {
      const value = this.$refs.inputRef.value
      this.$emit("input", value)
    },
  },
}
</script>

<style lang="less"></style>
